/**
 * Created with JetBrains PhpStorm.
 * User: yuri
 * Date: 11/19/14
 * Time: 4:20 PM
 * To change this template use File | Settings | File Templates.
 */
define(
    ['models/menuMd'],
    function(menuMd) {

        function GalleryMd() {
            this.bind = function(){
              menuMd.bind($('.galery_item'));
              setGallery();
              
            };

            function setGallery()
            {
                require(['gallery'],function(){
                    hs.graphicsDir = $('.for_gallery').data('grdir');
                    hs.showCredits = false;
                    hs.flushImgSize = true;
                    hs.align = 'center';
                    hs.transitions = ['expand', 'crossfade'];
                    hs.fadeInOut = true;
                    if (hs.addSlideshow) hs.addSlideshow({
                    interval: 5000,
                    repeat: false,
                    useControls: true,
                    fixedControls: 'fit',
                    overlayOptions: {
                    opacity: .6,
                    position: 'bottom center',
                    hideOnMouseOut: true
                    }
                    });
                    hs.dimmingOpacity = 0.75;
                    hs.outlineType = 'rounded-white'; 
                    
                    $('.gallery_link').click(function(){
                        hs.expand(this);

                    });
                });
                
            };


        };

        return new GalleryMd();
    });
